
import {postLoginUserN} from "@/http/profile"
export default{
  namespaced: true,
  state: {
    profile:null
  },
  getters: {},
  mutations: {
    setProfile(state,data){
      console.log(1)
       state.profile=data
    },
    updateImg(state,data){
      console.log(data.nickname,data.avatar,"你好")
      state.profile.nickname=data.nickname
      state.profile.avatar=data.avatar
    }
  },
  actions: {
    async getUserInof(store,data){
      // console.log(data)
       const res=await postLoginUserN(data)
       console.log(res)
       store.commit("setProfile",res.result)
    },
    setObj(context,data){
      context.commit("updateImg",data)
    }
  }}
